<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<style type="text/css">
.dateWidth1{
   width:195px;
}
.select_width{
   width:130px;
}
</style>

<table class="t_css table01" width="100%" border="0" cellpadding="0" id="basicInfo"
	cellspacing="1">
	<col style="width:18%"/>
	<col style="width:16%"/>
	<col style="width:16%"/>
	<col style="width:18%"/>
	<col style="width:16%"/>
	<col style="width:16%"/>
	<tr >
		<td   colspan="6" class="t_bar2">${param.title}</td>
		
	</tr>
	<tr >
		<td   align="right" ><span class="color_red">*</span>项目名称：</td>
		<td  colspan="5">
			<input id="zh_title"  name="proposal/zh_title" label="项目基本情况-->${param.title}-->项目名称" type="text" required class="input_css required maxlength:100"  style="width:597px;" maxlength="100" value="<x:out select="$xmlData/data/proposal/zh_title" />"/> 
		</td>
	</tr>
	<tr >
		<td   align="right" ><span class="color_red">*</span>所属行业：</td>
		<td  colspan="5">
				<c:set var="belon_industry">{'id':'<x:out select="$xmlData/data/proposal/belon_industry_code" />','name':'<x:out select="$xmlData/data/proposal/belon_industry_name" />'}</c:set>
        <cpt:tree key="belon_industry" cacheable="false" className="hn_iuput_kuang gray" readonly="true" value="${belon_industry}"  label="项目基本情况-->${param.title}-->所属行业"  width="597px"
          		    id="belon_industry" showPattern="current" shieldPattern="0" topCheckbox="false" onClick="initTreeValueTeamPerson" />
	         <input id="belon_industry_code" type="hidden" name="proposal/belon_industry_code" class="required" label="项目基本情况-->${param.title}-->所属行业" value="<x:out select="$xmlData/data/proposal/belon_industry_code" />"/>
           <input id="belon_industry_name" type="hidden" name="proposal/belon_industry_name"  value="<x:out select="$xmlData/data/proposal/belon_industry_name" />"/>
		</td>
	</tr>
	<tr >
		<td   align="right" ><span class="color_red">*</span>团队名称：</td>
		<td  colspan="5">
				<c:set var="team_person">{'id':'<x:out select="$xmlData/data/proposal/team_person_code" />','name':'<x:out select="$xmlData/data/proposal/team_person_name" />'}</c:set>
        <cpt:tree key="team_person" cacheable="false" className="hn_iuput_kuang gray" readonly="true" value="${team_person}"  label="项目基本情况-->${param.title}-->团队名称"  width="597px"
          		    id="team_person" showPattern="current" shieldPattern="0" topCheckbox="false" onClick="initTreeValueTeamPerson" />
	         <input id="team_person_code" type="hidden" name="proposal/team_person_code" class="required" label="项目基本情况-->${param.title}-->团队名称" value="<x:out select="$xmlData/data/proposal/team_person_code" />"/>
           <input id="team_person_name" type="hidden" name="proposal/team_person_name"  value="<x:out select="$xmlData/data/proposal/team_person_name" />"/>
		</td>
	</tr>
	<tr >
		<td   align="right" ><span class="color_red">*</span>所属产业：</td>
		<td  colspan="2">
			<c:set var="indust_type"><x:out select="$xmlData/data/proposal/indust_type_value" /></c:set>
			<cpt:select id="indust_type" style="width:140px;"   key="indust_type"  value="${indust_type}" onChange="initControlValue(this.id);"></cpt:select>
			<input type="hidden" id="indust_type_value" name="proposal/indust_type_value" class="required" value="${indust_type}" label="项目基本情况-->${param.title}-->所属产业">
			<input type="hidden" name="proposal/indust_type_name" value="<x:out select="$xmlData/data/proposal/indust_type_name" />">
		</td>
		<td   align="right" ><span class="color_red">*</span>所属学科：</td>
		<td  colspan="2">
          	<c:set var="subject">{'id':'<x:out select="$xmlData/data/proposal/subject_code" />','name':'<x:out select="$xmlData/data/proposal/subject_name" />'}</c:set>
          	<cpt:tree key="medically" cacheable="false" className="hn_iuput_kuang gray" readonly="true" value="${subject}"  label="项目基本情况-->${param.title}-->所属学科"
          		id="subject" showPattern="current" shieldPattern="0" topCheckbox="false" onClick="initTreeValue2" />
	        <input id="subject_code" type="hidden" name="proposal/subject_code" class="required" label="项目基本情况-->${param.title}-->所属学科" value="<x:out select="$xmlData/data/proposal/subject_code" />"/>
            <input id="subject_name" type="hidden" name="proposal/subject_name"  value="<x:out select="$xmlData/data/proposal/subject_name" />"/>
		</td>
	</tr>
	<%-- <tr >
	<td  align="right" nowrap><span class="color_red">*</span>专题名称：</td>
	<td colspan="2">
			 <c:set var="grantCode"><x:out select="$xmlData/data/proposal/grant_code" /></c:set>
			<c:set var="sub"><x:out select="$xmlData/data/proposal/sub_grant_code" /></c:set>
			<c:set var="domain">{'id':'<x:out select="$xmlData/data/proposal/domain_value" />','name':'<x:out select="$xmlData/data/proposal/domain_name" />'}</c:set>
          	<cpt:tree key="domain1" cacheable="false" className="hn_iuput_kuang gray" readonly="true" value="${domain}"  label="项目基本情况-->${param.title}-->专题名称"
          		id="domain" showPattern="current" shieldPattern="0" topCheckbox="false" onClick="localInitTreeValue" sqlParamVal="{grant_code:${sub},stat_year:${param.statYear }}"/>
	        <input id="domain_value" type="hidden" name="proposal/domain_value" class="required" label="项目基本情况-->${param.title}-->专题名称" value="<x:out select="$xmlData/data/proposal/domain_value" />"/>
            <input id="domain_name" type="hidden" name="proposal/domain_name"  value="<x:out select="$xmlData/data/proposal/domain_name" />"/>
            <input  type="hidden" id="domainsub_value" name="proposal/domainsub_value"  value="<x:out select="$xmlData/data/proposal/domainsub_value" />"/>
            <input id="domainsub_name" type="hidden" name="proposal/domainsub_name"  value="<x:out select="$xmlData/data/proposal/domainsub_name" />"/>
			 <input id="subject_no" type="hidden" name="proposal/subject_no"  value="<x:out select="$xmlData/data/proposal/subject_no" />"/>
	</td>
	<td  align="right" nowrap>技术领域：</td>
	<td colspan="2">
	        <input id="researcharea_value" type="hidden" name="proposal/researcharea_value"  value="<x:out select="$xmlData/data/proposal/researcharea_value" />"/>
            <span id="researcharea_name"  name="proposal/researcharea_name"><x:out select="$xmlData/data/proposal/researcharea_name" /></span>
	</td>
	</tr> --%>
	<tr >
	<td  align="right" nowrap><span class="color_red">*</span>项目开始日期：</td>
		<td colspan="2">
			<c:set var="start_date"><x:out select="$xmlData/data/proposal/start_date" /></c:set>
			<cpt:date id="start_date" name="proposal/start_date" value="${start_date}" className="required date  dateCompare:end_date" label="项目基本情况-->${param.title}-->项目开始日期" ></cpt:date> 
		</td>
		<td  align="right" nowrap ><span class="color_red">*</span>项目结束日期：</td>
		<td colspan="2">
			<c:set var="end_date"><x:out select="$xmlData/data/proposal/end_date" /></c:set>
			<cpt:date id="end_date" name="proposal/end_date" className="required date" label="项目基本情况-->${param.title}-->项目结束日期"  value="${end_date}" ></cpt:date> 
		</td>
	</tr>
	<tr >
	    <td  align="right" ><span class="color_red">*</span>申报日期：</td>
		<td colspan="2">
			<c:set var="submit_date"><x:out select="$xmlData/data/proposal/submit_date" /></c:set>
			<cpt:date id="submit_date" name="proposal/submit_date" value="${submit_date}" className=" required date" label="项目基本情况-->${param.title}-->申报日期"></cpt:date> 
		</td>
		<td  align="right" >归口管理部门：</td>
		<td colspan="2">
			<x:out select="$xmlData/data/proposal/tjbm_org_name"/>
		</td>
<%-- 		<td align="right"><span class="color_red">*</span>项目类型：</td>
		<td colspan="2">
			<c:set var="proposal_type"><x:out select="$xmlData/data/proposal/proposal_type_value" /></c:set>
			<cpt:select id="proposal_type"   key="proposal_type"  value="${proposal_type}" onChange="initControlValue(this.id);"></cpt:select>
			<input type="hidden" id="proposal_type_value" name="proposal/proposal_type_value" class="required" value="${proposal_type}" label="项目基本情况-->${param.title}-->项目类型">
			<input type="hidden" name="proposal/proposal_type_name" value="<x:out select="$xmlData/data/proposal/proposal_type_name" />">
		</td> --%>
	</tr>
		<tr >
	<td align="right"><span class="color_red">*</span>依托平台（重点实验&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>室、工程技术中心等）<br/>名称及审批部门：</td>
	<td nowrap  colspan="2" valign="middle">
	<label> <input type="radio" class="do " id="advant_01" style="vertical-align: middle;" onclick="showText(this.id);" name="innovate2" label="国家级" value="01" /><span style="vertical-align: middle;">国家级</span></label>
	<input type="text" name="proposal/innovate2_country" id="innovate2_country"  class="input_css  maxlength:100" style="display:none;width:95px;"  maxlength="100" value="<x:out select="$xmlData/data/proposal/innovate2_country" />" label="项目基本情况-->${param.title}-->依托平台（重点实验室、工程技术中心等）名称及审批部门-->国家级" /> 
	&nbsp; &nbsp; &nbsp;  
	<label> <input type="radio" class="do " id="advant_02" style="vertical-align: middle;"onclick="showText(this.id);" name="innovate2" label="省部级" value="02" /><span style="vertical-align: middle;">省部级</span></label>
	<input type="text" name="proposal/innovate2_city" id="innovate2_city"  class="input_css  maxlength:100" style="display:none;width:95px;"  maxlength="100" value="<x:out select="$xmlData/data/proposal/innovate2_city" />" label="项目基本情况-->${param.title}-->依托平台（重点实验室、工程技术中心等）名称及审批部门-->省部级" /> 
	&nbsp; &nbsp; &nbsp;  
	<label> <input type="radio" class="do" id="advant_03" style="vertical-align: middle;" onclick="showText(this.id);" name="innovate2" label="其他" value="03" /><span style="vertical-align: middle;">其他</span></label>
    <input type="text" name="proposal/innovate2_other" id="innovate2_other"  class="input_css  maxlength:100" style="display:none;width:95px;"  maxlength="100" value="<x:out select="$xmlData/data/proposal/innovate2_other" />" label="项目基本情况-->${param.title}-->依托平台（重点实验室、工程技术中心等）名称及审批部门-->其他" /> 
	<input type="hidden" name="proposal/innovate2_value" id="innovate2_value" class="required" value="<x:out select="$xmlData/data/proposal/innovate2_value" />" label="项目基本情况-->${param.title}-->依托平台名称及审批部门" /> 
	<input type="hidden" name="proposal/innovate2_name" id="innovate2_name" value="<x:out select="$xmlData/data/proposal/innovate2_name" />" label="项目基本情况-->${param.title}-->依托平台名称及审批部门" /></td>
	<td align="right"><span class="color_red">*</span>所属创新团队<br/>名称及审批部门：</td>
	<td nowrap  colspan="2" valign="middle">
	<label> <input type="radio" class="do " id="innovate_team_01" style="vertical-align: middle;" onclick="hideText(this.id);"  name="innovate_team" label="国家级" value="01" /><span style="vertical-align: middle;">国家级</span></label>
	<input type="text" name="proposal/innovate_team_country" id="innovate_team_country"  class="input_css  maxlength:100" style="display:none;width:95px;"  maxlength="100" value="<x:out select="$xmlData/data/proposal/innovate_team_country" />" label="项目基本情况-->${param.title}-->所属创新团队名称及审批部门-->国家级" /> 
	&nbsp; &nbsp; &nbsp;  
	<label> <input type="radio" class="do " id="innovate_team_02" style="vertical-align: middle;" onclick="hideText(this.id);"  name="innovate_team" label="省部级" value="02" /><span style="vertical-align: middle;">省部级</span></label>
	<input type="text" name="proposal/innovate_team_city" id="innovate_team_city"  class="input_css  maxlength:100" style="display:none;width:95px;"  maxlength="100" value="<x:out select="$xmlData/data/proposal/innovate_team_city" />" label="项目基本情况-->${param.title}-->所属创新团队名称及审批部门-->省部级" /> 
	&nbsp; &nbsp; &nbsp;  
	<label> <input type="radio" class="do " id="innovate_team_03" style="vertical-align: middle;" onclick="hideText(this.id);" name="innovate_team" label="其他" value="03" /><span style="vertical-align: middle;">其他</span></label>
	<input type="text" name="proposal/innovate_team_other" id="innovate_team_other"  class="input_css  maxlength:100" style="display:none;width:95px;"  maxlength="100" value="<x:out select="$xmlData/data/proposal/innovate_team_other" />" label="项目基本情况-->${param.title}-->所属创新团队名称及审批部门-->其他" /> 
	<input type="hidden" name="proposal/innovate_team_value" id="innovate_team_value" class="required" value="<x:out select="$xmlData/data/proposal/innovate_team_value" />" label="项目基本情况-->${param.title}-->所属创新团队名称及审批部门" /> 
	<input type="hidden" name="proposal/innovate_team_name" id="innovate_team_name" value="<x:out select="$xmlData/data/proposal/innovate_team_name" />" label="项目基本情况-->${param.title}-->所属创新团队名称及审批部门" /></td>
	</tr>
	</table>
	<br/>
<script type="text/javascript">


function initTreeValueTeamPerson(treeId, treeNode) {
  	//针对单位性质
  	if (( treeNode && treeNode.isParent)) {
		scmWarn("请选择具体的"+$("#" + treeId).attr("label"));
			$("#" + treeId).val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId+ "_code']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId+ "_value']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId+ "_name']").val("");
			return false;
	}
		var str = treeNode.name.split("-")[0];
		var obj = treeNode.parentNode;
		while (obj != null) {
			//str = obj.name + "-" + str;
			obj = obj.parentNode;
		}
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
		$("#" + treeId).val(str);
		initTreeValue2CallBack();
	}

function buildName(treeNode, params){
	if (null!=treeNode&&null!=params){
		var name = treeNode.name.split("-")[0];
		var names = name;
		var flag = true;
		if ($.trim(params.showPattern) == "all") { // 显示所有节点
			flag = false;
			var parent = treeNode.parentNode;
			var lev = 0;
			while (parent != null) {
				lev ++;
				names = parent.name+"," + names;
				parent = parent.parentNode;
			}
			names = names.split(",");
			var shield = $.trim(params.shieldPattern);
			var shields = shield.split(",");
			for (var i = shields.length - 1; i >= 1; i--) {	//过滤重复数据
				if (shields[i - 1] == shields[i]) {
					shields.splice(i, 1);
				}
			}
			shields.sort();	//对数组排序
			if (shields[0] > -1) { // 屏蔽节点
				for (var i = shields.length-1; i >= 0; i --) {
					if (shields[i] > lev) {
						continue;
					}
					if (shields[i] != "")
						names.splice(shields[i], 1);
				}
			}
		}
		name = "";
		if (flag) {
//			names += ",";
//			names = names.split(",");
			name = names;
		} else {
			for (var n in names) {
				name += names[n];
			}
		}
		return name;
	}
	return null;
}


$(document).ready(function(){
  	$("#basicInfo").each(function(){
  		$(this).find("tr:even").addClass("li_1");
  		$(this).find("tr:odd").addClass("li_2");
  	});
  });
  function setZhTitle(obj){
	  $("#intro_zh_title").text($(obj).val());
  }
  function localInitTreeValue(treeId, treeNode) {
		var str = treeNode.name;
		var obj = treeNode.parentNode;
		if (!(treeNode && (treeNode.level > 0 || !treeNode.isParent))) {
			scmWarn($("#" + treeId).attr("label")
					+ messageTip.researchAreaInvalidDisciplineCode);
			return false;
		}
		while (obj != null) {
			obj = obj.parentNode;
		}
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "sub_name'],[id$='" + treeId + "sub_name']").val(str.split("-")[0]);
		
		$("#" + treeId).parents("td").find("[name$='" + treeId + "sub_value'],[id$='" + treeId + "sub_value']").val(treeNode.id.split("-")[0]);
		$("#" + treeId).parents("td").find("[name$='subject_no']").val(str.split("-")[1]);
		$("#" + treeId).parents("tr").find("[name$='researcharea_name']").text(treeNode.parentNode.name);
		$("#" + treeId).parents("tr").find("[name$='researcharea_value']").val(treeNode.parentNode.id);
		$("#" + treeId).val(str);
}
  function showText(id){
		 var test = $("#"+id).val();
		 if(test=='01'){
			 $("#innovate2_country").show();
			 $("#innovate2_country").addClass("required");
			 $("#innovate2_city").hide();
			 $("#innovate2_city").removeClass("required");
			 $("#innovate2_city").val("");
			 $("#innovate2_other").hide();
			 $("#innovate2_other").removeClass("required");
			 $("#innovate2_other").val("");
		 }else if(test=='02'){
			 $("#innovate2_city").show();
			 $("#innovate2_city").addClass("required");
			 $("#innovate2_country").hide();
			 $("#innovate2_country").removeClass("required");
			 $("#innovate2_country").val("");
			 $("#innovate2_other").hide();
			 $("#innovate2_other").removeClass("required");
			 $("#innovate2_other").val("");
			
		 }else if(test=='03'){
			 $("#innovate2_other").show();
			 $("#innovate2_other").addClass("required");
			 $("#innovate2_country").hide();
			 $("#innovate2_country").removeClass("required");
			 $("#innovate2_country").val("");
			 $("#innovate2_city").hide();
			 $("#innovate2_city").removeClass("required");
			 $("#innovate2_city").val("");
		 }
		 
  }
  function hideText(id){
	  var test = $("#"+id).val();
	  if(test=='01'){
		 	 $("#innovate_team_country").show();
			 $("#innovate_team_country").addClass("required");
			 $("#innovate_team_city").hide();
			 $("#innovate_team_city").removeClass("required");
			 $("#innovate_team_city").val("");
			 $("#innovate_team_other").hide();
			 $("#innovate_team_other").removeClass("required");
			 $("#innovate_team_other").val("");
	  }else if(test=='02'){
		  	$("#innovate_team_city").show();
			 $("#innovate_team_city").addClass("required");
			 $("#innovate_team_country").hide();
			 $("#innovate_team_country").removeClass("required");
			 $("#innovate_team_country").val("");
			 $("#innovate_team_other").hide();
			 $("#innovate_team_other").removeClass("required");
			 $("#innovate_team_other").val("");
	  }else if(test=='03'){
		  	$("#innovate_team_other").show();
			 $("#innovate_team_other").addClass("required");
			 $("#innovate_team_country").hide();
			 $("#innovate_team_country").removeClass("required");
			 $("#innovate_team_country").val("");
			 $("#innovate_team_city").hide();
			 $("#innovate_team_city").removeClass("required");
			 $("#innovate_team_city").val("");
	  }
  }
  $(document).ready(function(){
	  var test01 =$("#innovate2_value").val();
	  if(test01=='01'){
			 $("#innovate2_country").show();
			 $("#innovate2_country").addClass("required");
			 $("#innovate2_city").hide();
			 $("#innovate2_city").removeClass("required");
			 $("#innovate2_city").val("");
			 $("#innovate2_other").hide();
			 $("#innovate2_other").removeClass("required");
			 $("#innovate2_other").val("");
		 }else if(test01=='02'){
			 $("#innovate2_city").show();
			 $("#innovate2_city").addClass("required");
			 $("#innovate2_country").hide();
			 $("#innovate2_country").removeClass("required");
			 $("#innovate2_country").val("");
			 $("#innovate2_other").hide();
			 $("#innovate2_other").removeClass("required");
			 $("#innovate2_other").val("");
			
		 }else if(test01=='03'){
			 $("#innovate2_other").show();
			 $("#innovate2_other").addClass("required");
			 $("#innovate2_country").hide();
			 $("#innovate2_country").removeClass("required");
			 $("#innovate2_country").val("");
			 $("#innovate2_city").hide();
			 $("#innovate2_city").removeClass("required");
			 $("#innovate2_city").val("");
		 }
	  var test02 = $("#innovate_team_value").val();
	  if(test02=='01'){
		 	 $("#innovate_team_country").show();
			 $("#innovate_team_country").addClass("required");
			 $("#innovate_team_city").hide();
			 $("#innovate_team_city").removeClass("required");
			 $("#innovate_team_city").val("");
			 $("#innovate_team_other").hide();
			 $("#innovate_team_other").removeClass("required");
			 $("#innovate_team_other").val("");
	  }else if(test02=='02'){
		  	$("#innovate_team_city").show();
			 $("#innovate_team_city").addClass("required");
			 $("#innovate_team_country").hide();
			 $("#innovate_team_country").removeClass("required");
			 $("#innovate_team_country").val("");
			 $("#innovate_team_other").hide();
			 $("#innovate_team_other").removeClass("required");
			 $("#innovate_team_other").val("");
	  }else if(test02=='03'){
		  	$("#innovate_team_other").show();
			 $("#innovate_team_other").addClass("required");
			 $("#innovate_team_country").hide();
			 $("#innovate_team_country").removeClass("required");
			 $("#innovate_team_country").val("");
			 $("#innovate_team_city").hide();
			 $("#innovate_team_city").removeClass("required");
			 $("#innovate_team_city").val("");
	  }
  });
</script>
